# $Id$
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: Damir Perisa <damir.perisa@bluewin.ch>

pkgname=kile
pkgver=2.9.91
pkgrel=3
pkgdesc="A user friendly TeX/LaTeX frontend for KDE"
arch=('i686' 'x86_64')
license=('GPL2')
url="https://kile.sourceforge.net/"
depends=('ktexteditor' 'kinit' 'okular' 'khtml' 'texlive-core')
makedepends=('extra-cmake-modules' 'kdoctools')
optdepends=('konsole: embedded terminal')
source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2"
        kile-local-url.patch)
sha256sums=('08cb54cddc54c851d98b339f386d9aa20b3d71ff98ef078242fd52f684712d93'
            '2cea79a285fe8b481d64088a87b0e6bccd1091a9ac08c934cdead7dcb7bd1fa3')

prepare() {
  mkdir -p build

  cd $pkgname-$pkgver
  patch -p1 -i ../kile-local-url.patch # Fix opening local URLs
}

build() {
  cd build
  cmake ../${pkgname}-${pkgver} \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib
  make
}

package() {
  cd build
  make DESTDIR="${pkgdir}" install
}
